/* 网络监控仪表盘样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 300;
}

.header .info {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 导航菜单样式 */
.nav-menu {
    display: flex;
    gap: 15px;
    align-items: center;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    font-weight: 600;
}

/* 汇总卡片样式 */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.card-icon {
    font-size: 2rem;
    line-height: 1;
}

.card-details {
    flex: 1;
}

.card-title {
    font-size: 1rem;
    color: #667eea;
    margin-bottom: 5px;
    font-weight: 600;
}

.card-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    line-height: 1.2;
}

.card-label {
    font-size: 0.8rem;
    color: #666;
    margin-top: 2px;
}

/* 系统资源卡片样式 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    font-size: 2rem;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.stat-label {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-top: 5px;
}

/* 网卡表格样式 */
.interfaces-table {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.table-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px;
    font-size: 1.2rem;
    font-weight: 600;
}

/* 搜索和控制面板样式 */
.search-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    padding: 0 15px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.search-box:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.search-box:focus-within {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.search-box input {
    background: none;
    border: none;
    color: white;
    font-size: 14px;
    padding: 8px 12px;
    outline: none;
    width: 180px;
    transition: width 0.3s ease;
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
}

.search-box input:focus {
    width: 220px;
}

.search-icon {
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    margin-right: 5px;
}

.clear-search {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.2s ease;
    font-size: 14px;
    margin-left: 5px;
}

.clear-search:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* 美化的复选框样式 */
.custom-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    padding: 8px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    color: white;
}

.custom-checkbox:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.custom-checkbox input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.custom-checkbox input[type="checkbox"]:checked {
    background: white;
    border-color: white;
}

.custom-checkbox input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    left: 2px;
    top: -2px;
    color: #667eea;
    font-size: 14px;
    font-weight: bold;
}

.custom-checkbox:has(input:checked) {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

/* 搜索结果提示 */
.search-results-info {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 14px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-results-info.hidden {
    display: none;
}

.search-highlight {
    background: rgba(255, 235, 59, 0.3);
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: bold;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #667eea;
}

th.sortable {
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
    position: relative;
}

th.sortable:hover {
    background: linear-gradient(135deg, #e9ecef, #dee2e6);
    color: #667eea;
    transform: translateY(-1px);
}

th.sortable.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

th .sort-icon {
    margin-left: 5px;
    font-size: 12px;
    opacity: 0.6;
    transition: all 0.3s ease;
}

th.sortable:hover .sort-icon {
    opacity: 1;
}

th.sortable .sort-icon::after {
    content: '⇅';
    color: #adb5bd;
}

th.sortable.sort-asc .sort-icon::after {
    content: '↑';
    color: #28a745;
    font-weight: bold;
}

th.sortable.sort-desc .sort-icon::after {
    content: '↓';
    color: #dc3545;
    font-weight: bold;
}

th.sortable.active .sort-icon {
    opacity: 1;
    font-weight: bold;
    color: white;
}

th.sortable.active.sort-asc .sort-icon::after {
    color: #90ff90;
}

th.sortable.active.sort-desc .sort-icon::after {
    color: #ffb3b3;
}

/* 无排序状态（默认状态）的视觉反馈 */
th.sortable:not(.sort-asc):not(.sort-desc) .sort-icon::after {
    content: '⇅';
    color: #adb5bd;
    font-weight: normal;
}

tr:hover {
    background: #f8f9fa;
}

.speed-indicator {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.speed-high {
    background: #e3f2fd;
    color: #1976d2;
}

.speed-medium {
    background: #fff3e0;
    color: #ff9800;
}

.speed-low {
    background: #e8f5e8;
    color: #4caf50;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.error {
    background: #ffebee;
    color: #c62828;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: white;
    opacity: 0.8;
}

/* 总数据行样式 */
.total-row {
    background-color: rgba(0, 255, 127, 0.1);
    border-top: 2px solid #00ff7f;
    font-weight: bold;
}

.total-row td {
    padding: 12px 15px;
}

.interface-type.total {
    background-color: rgba(0, 255, 127, 0.3);
    color: #00ff7f;
    font-weight: bold;
}

/* 表格样式优化 */
.interfaces-table table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0;
}

.interfaces-table th {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 15px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #00ff7f;
}

.interfaces-table td {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s ease;
}

.interfaces-table tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.total-row:hover {
    background-color: rgba(0, 255, 127, 0.15);
}

.interface-type {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.interface-type.physical {
    background-color: rgba(0, 255, 127, 0.2);
    color: #00ff7f;
}

.interface-type.virtual {
    background-color: rgba(255, 165, 0, 0.2);
    color: #ffa500;
}

/* 虚拟网卡显示开关样式 */
#show-virtual {
    margin-right: 6px;
    transform: scale(1.2);
}

label[for="show-virtual"] {
    cursor: pointer;
    user-select: none;
}

label[for="show-virtual"]:hover {
    color: #00ff7f;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 10px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    th, td {
        padding: 10px;
        font-size: 0.9rem;
    }
    
    .table-header > div {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 15px;
    }
    
    .search-controls {
        width: 100%;
        justify-content: center;
        flex-direction: column;
        gap: 10px;
    }
    
    .search-box {
        width: 100%;
        max-width: 300px;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .search-box input:focus {
        width: 100%;
    }
    
    .custom-checkbox {
        justify-content: center;
        min-width: 140px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .nav-menu {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .search-results-info {
        text-align: center;
        margin-top: 10px;
    }
}